import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class MyListItem extends StatelessWidget {
  final String content;
  IconData icons;
  var _onTap;
  final String data;
  var _icon = false;
  bool _editable = false;

  MyListItem(this.content, this.icons, this._onTap, this.data): _icon = true;


  MyListItem.of(this.content, this.data, {var onTap, bool editable}): _editable = editable, _onTap = onTap;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 60,
      child: InkWell(
        splashColor: Colors.black38,
        onTap: _onTap,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          mainAxisSize: MainAxisSize.max,
          children: [
            Row(
                children: [
                  Visibility(child: Icon(icons), visible: _icon),
                  SizedBox(width: 16,),
                  Text(content),
                ]
            ),
            Align(
              alignment: Alignment.centerRight,
                child: Row(
                    children: [
                      Visibility(child: Text(data ?? ""), visible: data != null,),
                      Icon(Icons.chevron_right)
                    ],
                )
            )
          ],
        ),
      ),
    );
  }
}